<script setup lang="ts">
	import { onLoad } from "@dcloudio/uni-app";
	import { reactive } from "vue";
	import Tabbar from '@/components/tabbar/tabbar.vue'

	// 方案一：
	// import { useRouter } from 'uni-mini-router';
	// // 使用 hooks（推荐）
	// let router = useRouter();
	// 方案二：
	import {router} from "@/router";

	onLoad((option) => {
		console.log('>>>> mine: ', option)
	})

	// uni-mini-router 使用方式：
	const tabBarList = [
		{
			index: 1,
			title: "首页",
			icon: "home",
			onClick: () => router.push({ name: 'home', params: { username: 'eduardo' } })
		},
		{
			index: 2,
			title: "扫一扫",
			icon: "scan",
			float: true,
			onClick: () => console.log("打开相机")
		},
		{
			index: 3,
			title: "我的",
			icon: "person",
			onClick: () => router.push({ name: "mine" })
		}
	]
</script>

<template>
	<view class="main-box">
		我的
		<tabbar :tab-bar-list="tabBarList" :current="3"></tabbar>
	</view>
</template>

<style scoped lang="scss">
	.main-box {
		padding-top: 70px;
	}
</style>